using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using Instedd.Labs.Geo.Library.Sms;

public partial class GeoRssList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AddRssLinks();
        }
    }

    private void AddRssLinks()
    {
        foreach(string file in Directory.GetFiles(SmsManager.GetManager().Configuration.RssOutput, "*.rss"))
        {
            TableRow row = new TableRow();
            TableCell cell = new TableCell();

            HyperLink rssLink = new HyperLink();
            rssLink.NavigateUrl = file;
            rssLink.Text = System.IO.Path.GetFileName(file);

            cell.Controls.Add(rssLink);
            row.Cells.Add(cell);
            RssFilesTable.Rows.Add(row);
        }
    }
}